<template>
	<view>
		<template v-if="zxsInfo != null">
			<user-info-rz :zxsInfo="zxsInfo" :parScName="parScName"></user-info-rz>
			<zxs-info-mod :zxsInfo="zxsInfo" :scRange="scRange" currPage="zxsRz"></zxs-info-mod>
			<view class="btnGroup" v-if="fromPage != 'minePage_sp'">
				<button class="comBtn" @tap="goSubmitArchive">提交资料</button>
			</view>
		</template>
		<template v-else>
			<view class="loadingWrap">
				<loading load-type="2"></loading>
			</view>
		</template>
	</view>
</template>

<script>
	import UserInfoRz from '@/components/zxs-archive/user-info-rz'
	import ZxsInfoMod from '@/components/zxs-archive/zxs-info-mod' 
	import { getZxsArchive } from '@/api/mine/index.js'
	export default {
		components:{
			UserInfoRz,
			ZxsInfoMod
		},
		data(){
			return{
				archiveId:0,
				zxsInfo:null,
				parScName:[],
				scRange:[],
				fromPage:''//minePage againApply minePage_sp(个人档案)
			}
		},
		onLoad(option){
			this.fromPage = option.fromPage;
			this.loadSelfArchive();
		},
		methods:{
			loadSelfArchive(){
				getZxsArchive().then(res=>{
					this.zxsInfo = res.data.datas;
					for(var i=0;i<this.zxsInfo.scRangeList.length;i++){
						this.scRange.push(this.zxsInfo.scRangeList[i]);
						this.parScName.push(this.zxsInfo.scRangeList[i].parentLyName);
					}
				}).catch(err=>{
					console.log(err)
				});
			},
			goSubmitArchive(){
				uni.navigateTo({
					url:'/pages/subMine/applyRz/selGrid?fromPage=' + this.fromPage
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		border-top: $comBor;
	}
	.btnGroup{
		height: var(--hei120);
		position: sticky;
		bottom: 0;
		background: #fff;
		box-shadow: 0 -10rpx 10rpx rgba(127, 188, 255, .1);
		display: flex;
		align-items: center;
		.comBtn{
			flex: 1;
			height: var(--hei80);
			border-radius: 50rpx;
			line-height: var(--hei80);
			font-size: 30rpx;
			margin: 0 30rpx;
		}
	}
</style>